package org.dtrevien.metamodel.java;

import java.util.ArrayList;
import java.util.List;

import org.dtrevien.metamodel.java.visitor.Visitor;

public class Methode {

	protected String name;
	protected Classe type;
	protected Visibility visibility;
	protected List<Attribut> params;
	
	public Methode() {
		this.params = new ArrayList<Attribut>();
	}
	
	public Methode(Classe type, String name, Visibility visibility, List<Attribut> params) {
		super();
		this.name = name;
		this.type = type;
		this.visibility = visibility;
		this.params = params;
	}
	
	public Methode(Classe type, String name, Visibility visibility) {
		super();
		this.name = name;
		this.type = type;
		this.visibility = visibility;
		this.params = new ArrayList<Attribut>();
	}

	public String getName() {
		return this.name;
	}

	public Classe getType() {
		return this.type;
	}

	public Visibility getVisibility() {
		return this.visibility;
	}

	public List<Attribut> getParams() {
		return this.params;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setType(Classe type) {
		this.type = type;
	}

	public void setVisibility(Visibility visibility) {
		this.visibility = visibility;
	}

	public void setParams(List<Attribut> params) {
		this.params = params;
	}
	
	public void accept(Visitor v) {
		v.visiteMethode(this);
	}
	
}
